//
//  XieYiTableViewCell.m
//  TQY
//
//  Created by 甘世清 on 2024/8/23.
//

#import "XieYiTableViewCell.h"

@implementation XieYiTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
- (void)SQ_Style:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
   
    UIView * bgView = [[UIView alloc]init];
    bgView.backgroundColor = UIColor.whiteColor;
    bgView.layer.cornerRadius = 10;
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(10, 12, 0, 12));
    }];
    
    UIImageView * rightImage = [[UIImageView alloc]init];
    rightImage.image = SQGetImage(@"返回");
    [bgView addSubview:rightImage];
    [rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(bgView);
            make.size.mas_equalTo(16);
            make.right.equalTo(bgView.mas_right).offset(-10);
    }];
    [bgView addSubview:self.messageLabel];
    [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgView).offset(24);
        make.centerY.equalTo(bgView);
    }];
}

- (UILabel *)messageLabel{
    if (!_messageLabel) {
        _messageLabel = [[UILabel alloc]init];
        _messageLabel.font = FONT_REGULAR(14);
        _messageLabel.textColor = UIColor.blackColor;
        _messageLabel.backgroundColor = UIColor.clearColor;
        _messageLabel.numberOfLines = 0;
    }
    return _messageLabel;
}
@end
